<?php

namespace app\controllers;

use Yii;
use app\models\User;
use yii\web\Controller;

class LoginController extends Controller
{
	// public $layout = 'post';
	public function actionIndex()
	{

		$id = Yii::$app->request->get('id');

		$id = $_GET['id'];

		var_dump($id);

		// $posts = Yii::$app->db->createCommand('SELECT * FROM fly_user')
  //           ->queryAll();


        $posts = (new \yii\db\Query())
	    ->select(['nickname', 'email'])
	    ->from('fly_user')
	    ->where(['sex' => '男'])
	    ->limit(3)
	    ->all();


	    $posts = User::find()->all();

         


		return $this->render('login',['user'=>$posts]);
	}
}